<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>判断是否为质数</title>
    <script>
         var n = parseInt(prompt("请输入一个数值",6))
         var i;
         for(i=2;i<n;i++){
             if(n % i ===0){
                 alert("它不是一个质数")
                 break;
             }
         }
         if(i===n){
            alert("它是一个质数")
         }
        
    </script>
</head>
<body>
    
</body>
</html>